package com.chensheng.controller;

import com.chensheng.service.WebSocket;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author:ChenSheng
 * @Description:
 * @Date: Created in 上午 10:12 2018/5/20 0020
 */
@Controller
@Slf4j
public class TestController {

    @Autowired
    private WebSocket webSocket;

    @GetMapping("/testw")
    @ResponseBody
    public String testw(){
        webSocket.sendMessage("testw");
        return "testw";
    }

}
